import datetime

from nacos_mcp_wrapper.server.nacos_mcp import NacosMCP
from nacos_mcp_wrapper.server.nacos_settings import NacosSettings

nacos_settings = NacosSettings()
nacos_settings.SERVER_ADDR = "10.211.55.30:8848"
nacos_settings.SERVICE_NAME = "nacos-mcp-server-python"
nacos_settings.NAMESPACE = "public"
nacos_settings.USERNAME = "nacos"
nacos_settings.PASSWORD = "nacos"

mcp = NacosMCP("nacos-mcp-server-python", nacos_settings=nacos_settings, port=8002)


@mcp.tool(name="get_date_time", description="获取时间日期")
def get_date_time() -> str:
    return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")


def main():
    mcp.run(transport="streamable-http")
    # mcp.run(transport="sse")
    print("nacos-mcp-server-python start successfully!")


if __name__ == "__main__":
    main()
